package svgedit.gui.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import svgedit.gui.Frame;
import svgedit.gui.command.DeleteCommand;

/** Deletes all selected elements.
 *
 */
@SuppressWarnings("serial")
public class DeleteAction extends AbstractAction {

    private Frame frame;

    /** Create this action for the given frame */
    public DeleteAction(Frame frame) {
        super("Delete");
        this.frame = frame;
    }

    public void actionPerformed(ActionEvent ae) {
       DeleteCommand deleteCommand = new DeleteCommand(frame);
       frame.getView().getCommandStack().addCommand(deleteCommand);
    }

}
